<template>
	<view class="search">
		<!-- #ifdef APP-PLUS -->
		<top-set></top-set>
		<!-- #endif -->
		<view class="head">
			
			<view class="search_input">
				<view class="input_box">
					<image class="i_img" src="/static/icon/search.png" mode=""></image>
					<input class="i_input" type="text" confirm-type="search" v-model="key" value=""  placeholder="请输入酒店名称" @confirm="toSearch"/>
					<view class="close_box" @tap="closeKey" v-if="key">
						<image class="i_close" src="/static/icon/s-cuo.png" mode=""></image>
					</view>
					
				</view>
				
			</view> 
			<view class="cancel">
				取消
			</view>
		</view>
		<view class="content">
			<view class="history_search ">
				<view class="h_head">
					历史搜索
				</view>
				<view class="h_content">
					<view class="h_list uni-clearfix">
						<view class="h_item" v-for="(v,i) in 10" :key="i">
							快捷酒店
						</view>
					</view>
				</view>
			</view>
			<view class="hot_search ">
				<view class="h_head">
					热门搜索
				</view>
				<view class="h_content">
					<view class="h_list uni-clearfix">
						<view class="h_item" v-for="(v,i) in 10" :key="i">
							快捷酒店
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		
		data() {
			return {
				key: ''
			}
		},
		methods: {
			toSearch(){
				console.log(this.key);
				uni.navigateTo({
					url: '/pages/cleaner/search/hotel-list'
				});
			},
			closeKey(){
				this.key = '';
			}
		},
		mounted(){
			
		},
		computed:{
			
		}
	}
</script>

<style scoped lang="scss">
	.search > .head{
		height: 88upx;
		width: 100%;
		box-sizing: border-box;
		position: relative;
		padding: 0 24upx;
		.search_input {
			float: left;
			width: calc( 100% - 92upx);
			height: 100%;
			position: relative;
			.input_box{
				position: absolute;
				left: 0;
				top: 16upx;
				width: 100%;
				height: 60upx;
				border: 1px solid #999999;
				border-radius: 60upx;
				// box-sizing: border-box;
				.i_img{
					position: absolute;
					left: 30upx;
					top:18upx;
					width: 25upx;
					height: 25upx;
				}
				.i_input{
					position: absolute;
					top: 0;
					left: 69upx;
					line-height: 60upx;
					width: 440upx;
					height: 60upx;
					color: #999999;
					font-size: 28upx;
					
				}
				.close_box{
					position: absolute;
					top: 0;
					right: 0;
					width: 86upx;
					height: 100%;
					.i_close{
						position: absolute;
						width: 29upx;
						height: 29upx;
						top: 15upx;
						right: 30upx;
					}
				}
				
			}
		}
		
		.cancel{
			float: right;
			width: 92upx;
			height: 100%;
			text-align: center;
			color: #999999;
			font-size: 28upx;
			line-height: 92upx;
		}
		
	}
	.head:after{
		position: absolute;
		content: '';
		left: 0;
		bottom: 0;
		width: 100%;
		height: 1upx;
		transform: scaleY(0.5);
		background-color:#e5e5e5; 
	}
	.content{
		
		.history_search , .hot_search{
			margin: 0 auto;
			margin-top: 40upx;
			width: calc(100% - 52upx);
			
		}
		.h_head{
			font-size: 24upx;
			line-height: 1;
			color: #999999;
		}
		.h_content{
			margin-top: 32upx;
			.h_list{
				
				.h_item{
					float: left;
					height: 50upx;
					font-size: 24upx;
					color: #999999;
					line-height: 50upx;
					box-sizing: border-box;
					border:1upx solid #e5e5e5;
					padding: 0 16upx;
					border-radius: 8upx;
					margin-right: 30upx;
					margin-bottom: 20upx;
				}
			}
			
		}
	}
</style>
